package com.ruoyi.project.ums.service;

import java.time.LocalDateTime;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.ums.mapper.UmsFeedbackMapper;
import com.ruoyi.db.ums.domain.UmsFeedback;
import com.ruoyi.db.ums.domain.query.UmsFeedbackQueryVo;

/**
 * 意见反馈Service业务层处理
 *
 * @author ruoyi
 * @date 2020-04-22
 */
@Service
public class UmsFeedbackService
{
    @Autowired
    private UmsFeedbackMapper umsFeedbackMapper;

    /**
     * 查询意见反馈
     *
     * @param id 意见反馈ID
     * @return 意见反馈
     */
    public UmsFeedback selectUmsFeedbackById(Long id)
    {
        return umsFeedbackMapper.selectUmsFeedbackById(id);
    }

    /**
     * 查询意见反馈列表
     *
     * @param umsFeedback 意见反馈
     * @return 意见反馈
     */
    public List<UmsFeedback> selectUmsFeedbackList(UmsFeedbackQueryVo umsFeedbackQueryVo)
    {
        return umsFeedbackMapper.selectUmsFeedbackList(umsFeedbackQueryVo);
    }

    /**
     * 新增意见反馈
     *
     * @param umsFeedback 意见反馈
     * @return 结果
     */
    public int insertUmsFeedback(UmsFeedback umsFeedback)
    {
        return umsFeedbackMapper.insertUmsFeedback(umsFeedback);
    }

    /**
     * 修改意见反馈
     *
     * @param umsFeedback 意见反馈
     * @return 结果
     */
    public int updateUmsFeedback(UmsFeedback umsFeedback)
    {
        umsFeedback.setUpdateTime(LocalDateTime.now());
        return umsFeedbackMapper.updateUmsFeedback(umsFeedback);
    }

    /**
     * 批量删除意见反馈
     *
     * @param ids 需要删除的意见反馈ID
     * @return 结果
     */
    public int deleteUmsFeedbackByIds(Long[] ids)
    {
        return umsFeedbackMapper.deleteUmsFeedbackByIds(ids);
    }

    /**
     * 删除意见反馈信息
     *
     * @param id 意见反馈ID
     * @return 结果
     */
    public int deleteUmsFeedbackById(Long id)
    {
        return umsFeedbackMapper.deleteUmsFeedbackById(id);
    }
}
